
using System;
using System.Collections.Generic;
using System.Text;
using NFinal.Extension;

namespace BlackHtml5.WebSite.Models.Entity.Common
{
    public struct content:NFinal.IModel
    {
		public System.Int64 id;
		public System.String module;
		public System.String yun;
		public System.String domain;
		public System.String fileType;
		public System.Byte? isSuccess;
		public System.Byte? isDeleted;
		public System.String localUrl;
		public System.String yunUrl;
		public System.String keyStr;
		public System.String file;
		public System.String bucketName;
		public System.String accessId;
		public System.String accessKey;
		public System.String sceretKey;
		#region Nullable
		private bool __is_null__;
        public bool __Is_Null__
        {
            get {
                return __is_null__;
            }
            set
            {
                 __is_null__=value;
            }
        }
        public static implicit operator content(string __value__)
        {
            var __value2__ = new content();
            __value2__.__Is_Null__ = __value__==null;
            return __value2__;
        }
        public static  bool operator true(content __value__)
        {
            return !__value__.__is_null__;
        }
        public static bool operator false(content __value__)
        {
            return !__value__.__is_null__;
        }
		#endregion
		#region 从get列表初始化实体类
		public static bool TryParse(NFinal.NameValueCollection get,out content par)
		{
			par=new content();
			try
			{
						System.Int64.TryParse(get["id"],out par.id);
						par.module=get["module"];
						par.yun=get["yun"];
						par.domain=get["domain"];
						par.fileType=get["fileType"];
						par.isSuccess=null;
						if(get["isSuccess"]!=null)
						{
							par.isSuccess=get["isSuccess"].AsVar();
						}
						par.isDeleted=null;
						if(get["isDeleted"]!=null)
						{
							par.isDeleted=get["isDeleted"].AsVar();
						}
						par.localUrl=get["localUrl"];
						par.yunUrl=get["yunUrl"];
						par.keyStr=get["keyStr"];
						par.file=get["file"];
						par.bucketName=get["bucketName"];
						par.accessId=get["accessId"];
						par.accessKey=get["accessKey"];
						par.sceretKey=get["sceretKey"];
			}
			catch
			{
				return false;
			}
			return true;
		}
		#endregion
		#region 写Json字符串
		public void WriteJson(System.IO.TextWriter tw)
		{
			tw.Write("{");
					tw.Write("\"id\":");
					tw.Write(id.ToString());
					tw.Write(",");
					tw.Write("\"module\":");
					tw.Write("\"");
					tw.Write(module==null?"null":module);
					tw.Write("\"");
					tw.Write(",");
					tw.Write("\"yun\":");
					tw.Write("\"");
					tw.Write(yun==null?"null":yun);
					tw.Write("\"");
					tw.Write(",");
					tw.Write("\"domain\":");
					tw.Write("\"");
					tw.Write(domain==null?"null":domain);
					tw.Write("\"");
					tw.Write(",");
					tw.Write("\"fileType\":");
					tw.Write("\"");
					tw.Write(fileType==null?"null":fileType);
					tw.Write("\"");
					tw.Write(",");
					tw.Write("\"isSuccess\":");
					tw.Write(isSuccess==null?"null" : isSuccess.ToString());
					tw.Write(",");
					tw.Write("\"isDeleted\":");
					tw.Write(isDeleted==null?"null" : isDeleted.ToString());
					tw.Write(",");
					tw.Write("\"localUrl\":");
					tw.Write("\"");
					tw.Write(localUrl==null?"null":localUrl);
					tw.Write("\"");
					tw.Write(",");
					tw.Write("\"yunUrl\":");
					tw.Write("\"");
					tw.Write(yunUrl==null?"null":yunUrl);
					tw.Write("\"");
					tw.Write(",");
					tw.Write("\"keyStr\":");
					tw.Write("\"");
					tw.Write(keyStr==null?"null":keyStr);
					tw.Write("\"");
					tw.Write(",");
					tw.Write("\"file\":");
					tw.Write("\"");
					tw.Write(file==null?"null":file);
					tw.Write("\"");
					tw.Write(",");
					tw.Write("\"bucketName\":");
					tw.Write("\"");
					tw.Write(bucketName==null?"null":bucketName);
					tw.Write("\"");
					tw.Write(",");
					tw.Write("\"accessId\":");
					tw.Write("\"");
					tw.Write(accessId==null?"null":accessId);
					tw.Write("\"");
					tw.Write(",");
					tw.Write("\"accessKey\":");
					tw.Write("\"");
					tw.Write(accessKey==null?"null":accessKey);
					tw.Write("\"");
					tw.Write(",");
					tw.Write("\"sceretKey\":");
					tw.Write("\"");
					tw.Write(sceretKey==null?"null":sceretKey);
					tw.Write("\"");

			tw.Write("}");
		}
		#endregion
    }
}
